package justcents.game.sticks;

import justcents.games.andengine.screen.SceneManager;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.engine.options.EngineOptions;
import org.anddev.andengine.engine.options.EngineOptions.ScreenOrientation;
import org.anddev.andengine.engine.options.resolutionpolicy.FillResolutionPolicy;
import org.anddev.andengine.entity.scene.Scene;
import org.anddev.andengine.entity.util.FPSLogger;
import org.anddev.andengine.ui.activity.BaseGameActivity;

public class Main extends BaseGameActivity {

	public static final int CAMERA_WIDTH = 512;
    public static final int CAMERA_HEIGHT = 1024;
   
    private Engine engine;
    private Camera camera;

    
    
    public Engine onLoadEngine() {
            this.camera = new Camera(0,0,CAMERA_WIDTH,CAMERA_HEIGHT);
            // FillResolutionPolicy() is used here in an attempt to cater for
            // multiple screen resolutions
            this.engine = new Engine(
                            new EngineOptions(true,ScreenOrientation.PORTRAIT,
                                            new FillResolutionPolicy(), this.camera
                                            )
                            );
            return this.engine;
    }

    public void onLoadResources() {
    	SceneManager.init(this);
    	
    	//Chamando a cena do menu principal
    	MainMenuScreen.load(this);
    	
    }

    public Scene onLoadScene() {
        this.mEngine.registerUpdateHandler(new FPSLogger());
        return MainMenuScreen.run();
    }

    public void onLoadComplete() {}
}
